package com.lej.dataservice.club.data

import android.Manifest
import com.lej.core.permission.PerInterface
import com.lej.dataservice.club.bean.TipsKey

enum class PengPermissions(
    private var needPermissions: Array<String>,
    private var tipsKey: TipsKey,
    private var permissionStr: String
) : PerInterface {
    location(arrayOf(Manifest.permission.ACCESS_COARSE_LOCATION,
        Manifest.permission.ACCESS_FINE_LOCATION
    ), TipsKey.sys_gps, "定位"
    ),
    camera(
        arrayOf(Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE),
        TipsKey.sys_storage,
        "相机和存储"
    ),
    store(arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE),
        TipsKey.store,
        "存储"
    )
    ;

    override fun getNeedPermissions() = needPermissions

    override suspend fun getTitle() = tipsKey.tips()?.title ?: "允许权限？"

    override suspend fun getContent() = tipsKey.tips()?.content ?: "开启权限"

    override fun getPermissionStr() = permissionStr
}